package com.sugar.starter;

import com.sugar.entity.MyProperties;
import com.sugar.service.MyService;
import com.sugar.service.MyServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(MyProperties.class)
public class MyAutoConfiguration {

    @Autowired
    private MyProperties properties;

    @Bean
    public MyService myService(){
        return new MyServiceImpl(properties);
    }
}
